// 原型模式

#include <iostream>

class Clone
{
private:
    /* data */
public:
    virtual Clone* clone() = 0;
    virtual void show() = 0;
};


class Sheep : public Clone
{
private:
    int m_ID;
    std::string m_name;

public:
    Sheep(int id, const char* name) : m_ID(id), m_name(name)
    {

    }
    ~Sheep()
    {

    }
    Sheep(const Sheep& obj)
    {
        this->m_ID = obj.m_ID;
        this->m_name = obj.m_name;
    }
    Clone* clone()
    {
        return new Sheep(*this);
    }

    void show()
    {
        std::cout << "ID: " << m_ID << " name: " << m_name.data() << "\n";
    }
};


int main(int argc, char const *argv[])
{
    int i = 0;
    int j = i++;
    std::cout << j << "\n";
    j = ++i;
    std::cout << j << "\n";
    Clone* s1 = new Sheep(101, "李四");
    s1->show();
    Clone* s2 = s1->clone();
    s2->show();
    return 0;
}

